interface ShapeArea{

    public abstract double getArea();

    public abstract double getPerimeter();

}

class Rectangle implements ShapeArea{

    double width;
    double height;
    Rectangle(double w,double h){
    this.width=w;
    this.height=h;}

public double getArea() {
    double w = 1.0 ;
    double h = 2.0 ;
    return width * height;

}
 public double getPerimeter()

{
    double h = 1.0;
    double w = 2.0;

    return 2*(w + h);

}

public String toString() {

return "width="+ width +",height="+ height +",perimeter="+getPerimeter()+",area="+getArea();

}


}
class Circle implements ShapeArea{
   double r;
   double PI=3.14;
   Circle(double r){
   this.r=r;
   }
   public double getArea(){
   return PI*r*r;
   }
   public double getPerimeter(){
   return 2*PI*r;
   } 
    public String toString(){
      return "r="+r+  ",perimeter=" +getPerimeter()+",area="+getArea();
     }
}


public class Test{
    public static void main(String args[])
    {
        ShapeArea rectangle=new Rectangle(1.0,2.0);
        ShapeArea Circle=new Circle(2.0);
        System.out.println(rectangle.toString());
        System.out.println(Circle.toString());
    }

}
